INCLUDE = -I./include
SRCFOLDER = ./src/
PARAMS = -fopenmp -O2
CC = g++-4.2
MPICXX = mpic++

SERIALCPP = \
	src/Eratostenes.cpp src/EratostenesOpenMP.cpp \
	src/PalindromeChecker.cpp src/PalindromeCheckerOpenMP.cpp \
	src/WordDataReader.cpp src/PhraseDataReader.cpp \
	src/mainserial.cpp


OPENMPCPP = \
	src/Eratostenes.cpp src/EratostenesOpenMP.cpp \
	src/PalindromeChecker.cpp src/PalindromeCheckerOpenMP.cpp \
	src/WordDataReader.cpp src/PhraseDataReader.cpp \
	src/mainopenmp.cpp

MPICPP = \
	src/Eratostenes.cpp \
	src/PalindromeChecker.cpp \
	src/WordDataReader.cpp src/PhraseDataReader.cpp \
	src/mainmpi.cpp


all: serial openmp mpi

mpi: $(MPICPP)
	$(MPICXX) $(INCLUDE) $(MPICPP) -o trabalho2-mpi

openmp: $(OPENMPCPP)
	$(CC) $(INCLUDE) $(OPENMPCPP) $(PARAMS) -o trabalho2-openmp

serial: $(SERIALCPP)
	$(CC) $(INCLUDE) $(SERIALCPP) $(PARAMS) -o trabalho2-serial

clean:
	rm trabalho2-openmp trabalho2-mpi trabalho2-serial
	
